import request from '@/utils/request'
// import { Base64 } from 'js-base64'

// const queryString = require('querystring')
// const client_id = 'dic_manager_api_client_id'
// const client_secret = '123456'

export function refreshToken(refresh_token) {
  const data = {
    refresh_token
  }
  return request({
    url: '/auth/refreshToken',
    method: 'post',
    data: data
  })
}

export function loginForm(data) {
  return request({
    url: '/auth/login',
    method: 'post',
    data
  })
}

export function getInfo(data) {
  return request({
    url: '/middleuser/user/get',
    method: 'post',
    data
  })
}

export function permission(data) {
  return request({
    url: '/user/permission',
    method: 'post',
    data
  })
}

export function logout(token) {
  const data = { token }
  return request({
    url: '/auth/logout',
    method: 'post',
    data
  })
}
